#ifndef EVENTHANDLER_H
#define EVENTHANDLER_H

#include <SDL/SDL.h>
#include <map>

enum EventState{
  EH_NONE,
  EH_W,
  EH_A,
  EH_S,
  EH_D,
  EH_UP,
  EH_DOWN,
  EH_LEFT,
  EH_RIGHT,
  EH_O,
  EH_P,
  EH_LCLICK,
  EH_RCLICK,
  EH_NUMOPTS
};
enum EventTime{
  EH_CUR,
  EH_PREV,
  EH_NUMTIMES
};

class EventHandler{
 public:
  static void init();
  static bool getState(EventState estate, EventTime etime);
  static void pollEvents(void);
  static bool isRunning(void);
 private:
  static void onEvent(SDL_Event* Event);
  static void setHistory(void);
  static bool m_event_state[EH_NUMOPTS][EH_NUMTIMES];
  static bool m_running;
  static std::map<SDLKey,EventState> m_sdlk2eh;
};

#endif
